package org.fichtelmann.max.wow.raidorganizer.bean;

import java.util.Collection;
import java.util.Map;
import java.util.Set;

import org.fichtelmann.max.wow.raidorganizer.exception.runtime.IllegalOperationException;
import org.fichtelmann.max.wow.raidorganizer.primitives.Slot;

public class Equipment implements Map<Slot, Item> {
  private Map<Slot, Item> equipment;

  public Equipment(Map<Slot, Item> map) {
    equipment = map;
  }
  
  public int size() {
    return equipment.size();
  }

  public boolean isEmpty() {
    return equipment.isEmpty();
  }

  public boolean containsKey(Object slot) {
    return equipment.containsKey(slot);
  }

  public boolean containsValue(Object value) {
    return containsValue(value);
  }

  public Item get(Object slot) {
    return equipment.get(slot);
  }

  public Item put(Slot key, Item value) {
    if (!value.getSlot().equals(key)) {
      throw new IllegalOperationException("This item may not be put into this slot!");
    }
    return equipment.put(key, value);
  }

  public Item remove(Object key) {
    return equipment.remove(key);
  }

  public void putAll(Map<? extends Slot, ? extends Item> m) {
    equipment.putAll(m);
  }

  public void clear() {
    equipment.clear();
  }

  public Set<Slot> keySet() {
    return equipment.keySet();
  }

  public Collection<Item> values() {
    return equipment.values();
  }

  public Set<java.util.Map.Entry<Slot, Item>> entrySet() {
    return equipment.entrySet();
  }
  
}
